﻿using System;
using Update.Config;
using Update.Utils.Core;
using Update.Utils.Interfaces;
using Update.Utils.IO;
using Update.Utils.Logging;
using Update.Utils.Net;
using Update.Utils.System;

namespace Update.Servers {
    /// <summary>
    /// 服务工厂类，用于创建各种服务实例
    /// </summary>
    public static class ServiceFactory
    {
        /// <summary>
        /// 创建文件帮助类实例
        /// </summary>
        /// <returns>文件帮助类实例</returns>
        public static IFileHelper CreateFileHelper()
        {
            return new FileHelper();
        }

        /// <summary>
        /// 创建网络帮助类实例
        /// </summary>
        /// <returns>网络帮助类实例</returns>
        public static INetworkHelper CreateNetworkHelper()
        {
            return new NetworkHelper();
        }

        /// <summary>
        /// 创建日志帮助类实例
        /// </summary>
        /// <param name="logFilePath">日志文件路径</param>
        /// <param name="enableConsole">是否启用控制台输出</param>
        /// <param name="minLevel">最小日志级别</param>
        /// <returns>日志帮助类实例</returns>
        public static ILogHelper CreateLogHelper(string logFilePath = null, bool enableConsole = true, LogLevel minLevel = LogLevel.Debug)
        {
            return new LogHelper(logFilePath, enableConsole, minLevel);
        }

        /// <summary>
        /// 创建配置管理器实例
        /// </summary>
        /// <param name="configFilePath">配置文件路径</param>
        /// <returns>配置管理器实例</returns>
        public static IConfigManager CreateConfigManager(string configFilePath)
        {
            return new ConfigManager(configFilePath);
        }

        /// <summary>
        /// 创建系统帮助类实例
        /// </summary>
        /// <returns>系统帮助类实例</returns>
        public static ISystemHelper CreateSystemHelper()
        {
            return new SystemHelper();
        }

        /// <summary>
        /// 创建更新帮助类实例
        /// </summary>
        /// <returns>更新帮助类实例</returns>
        public static IUpdateHelper CreateUpdateHelper()
        {
            return new UpdateHelper();
        }
    }
} 